package xyz.heyaoshare.validation.validator;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 防SQL注入
 * @author YueHe
 * @version 0.0.1
 * @since 2025/6/26 下午2:57
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = SQLSafeValidator.class)
public @interface SQLSafe {

    boolean required() default true;

    String message() default "请求参数包含SQL注入风险";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
